package com.my.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class TextController {

  @RequestMapping("/text")
  public String text(Model model, HttpServletRequest request){

    model.addAttribute("text",request.getAttribute("loginUrl"));

    return "text";
  }

  @RequestMapping("/login")
  public String login(Model model, HttpServletRequest request){

    model.addAttribute("text",request.getAttribute("loginUrl"));

    return "login";
  }

  @RequestMapping("/success")
  public String success(Model model, HttpServletRequest request) {

    model.addAttribute("text", "登录成功");

    return "text";
  }
    @RequestMapping("/outsuccess")
    public String outsuccess(Model model, HttpServletRequest request){

      model.addAttribute("text","注销成功");

      return "text";
  }



  @RequestMapping("/loginError")
  public String loginError(Model model, HttpServletRequest request){

    model.addAttribute("text","登录失败");

    return "text";
  }

}
